<?php
defined('SEJUJOPEFDNGJSL') or exit('Access denied');

if($_POST['submit']=='删除'){
	if(empty($_POST["cbid"])) show_automsg('请先选择要删除的记录！',$GLOBALARR['curl'],1);
	$u_id=implode(",",$_POST["cbid"]);

	$db->sitedbexec("delete from ld_user_qianbao where id in($u_id)");

	record_log('删除信息');
	show_automsg('删除成功！',$GLOBALARR['curl']);
}

$pagecount=getnums($_GET["pagecount"],$GLOBALARR['pagecount']);
$option=getnums($_GET['option'],1);
$orderby=getnums($_GET['orderby'],1);
$quser=checkstr(trim($_GET['quser']));

$tmp_arr['toption'].='<a href="'.getqueurl('option',1).'" class="'.geteqval(array($option,1,'taselbtn','thabtn')).'">今日新增</a><a href="'.getqueurl('option',2).'" class="'.geteqval(array($option,2,'taselbtn','thabtn')).'">全部</a>
	<input type="submit" name="submit" onclick="checkone();"    value="删除" class="thabtn">
	 ';

$tmp_arr['torderby']='<a href="'.getqueurl('orderby',geteqval(array($orderby,1,'2','1'))).'" class="'.((strstr($orderby,'1')||strstr($orderby,'2'))?"tpaixusel":"tpaixu").'">'.geteqval(array($orderby,1,'时间↓','时间↑')).'</a>';

if(is_array($GLOBALARR['jjname'])){
foreach ($GLOBALARR['jjname'] as $k => $v) {
	$tmp_arr['tcolor'].='<a href="javascript:;" class="theacolor levelcolor'.$k.'">'.$v.'</a>';
}
}



$condition=' where 1=1 ';

if($quser){
	
		$condition.=" and addressname like '%".$quser."%'";
	
}
if($option==1) $condition.=" and from_unixtime(ctime,'%Y-%m-%d')='".date('Y-m-d')."'";


$order='';
if($orderby==1 || !$isset($order)) $order=' order by id asc';
if($orderby==2) $order=' order by id asc';


$tmp_arr['tth']='<th><input type="checkbox" onclick="javascript:checkall(\'cbid[]\')"></th><th>序号</th><th>账号</th><th>币种</th><th>钱包地址</th><th style="width:160px">添加日期</th><th>备注</th>';

$psql="select count(0) from ld_user_qianbao $condition";
// var_dump($psql);

$db->query($psql,3);
$pcount=$db->fval;
$pagecount=$pagecount;   //每页条数 
$astr="&lsaction=qianbaolist&pagecount=$pagecount&orderby=$orderby&option=$option&quser=$quser";	  //Url
$pagearr=pagelist($pagecount,$pcount,$astr);
$offset=$pagearr[1];

$sql="select * from ld_user_qianbao  $condition $order limit $offset,$pagecount";
// var_dump($sql);
$db->query($sql);
$ii=0;
$amount=0;
foreach ($db->rs as $k => $v) {
	$ii++;
	$serialid=($pagearr[2]-1)*$pagecount+$ii;
	
	$tmp_arr['ttr'].='<tr class="levelcolor">
						<td><input type="checkbox" name="cbid[]" value="'.$v['id'].'"></td>
						<td><span  title="'.$v["id"].'">'.$serialid.'</span></td>
						<td>'.$v['cuname'].'</td>
						<td align="left" >&nbsp;&nbsp;'.$v['coin'].'</td>
						<td align="left" >&nbsp;&nbsp;'.$v['addr'].'</td>
						<td align="center">'.date("Y-m-d H:i:s",$v['ctime']).'</a></td>
						<td>'.$v['name'].'</td>
						</tr>';


}


$tmp_arr['tcount']=$pcount;
$tmp_arr['ttitle']=getmenu($GLOBALARR['menu'],'addresslist');
$tmp_arr['tpage']=$pagearr[0];
admin_two($tmp_arr);

?>